home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 351-375 / 351 / pdc / bin.lzh / doc / Compiler.doc < prev    next >
Text File  |  1990-04-06  |  5KB  |  130 lines

  1. Compiler.doc
  2. ------------
  3.  
  4. Here are some short descriptions of the command line options offered in the
  5. current version of the compiler.  The reader should be aware that these options
  6. are distinct from the options available with the 'ccx' command.  The 'ccx'
  7. command presents a command line syntax similar to that found when programming
  8. under the UNIX operating system, while the compiler itself presents its own 
  9. unique command line syntax.  All option flags can be in either upper or lower
  10. case.  All switch-style options are actually toggled when their flag is seen.
  11. The actual default values can be specified at compile-time in the file
  12. CGlbDef.c.
  13.  
  14. -a    Annotate the assembly file created by the compiler with the line of
  15.     C code that each group of assembly statements represent.  Only the 
  16.         first line of a multi-line C statement is printed.
  17.  
  18. -b    Generate inline assembler for builtins rather than treating builtin
  19.     commands as function calls.  Supported functions can also be specified
  20.         as builtin by prepending "__BUILTIN_" to the function name, as in:
  21.  
  22.                          __BUILTIN_strcpy(a, b)
  23.  
  24.     The following functions are presently provided as builtins:
  25.  
  26.                     strcat          strcpy          bcopy
  27.                     strcmp          strlen          bzero
  28.  
  29. -D %s   Define the preprocessor symbol %s.  As currently implemented, the
  30.         symbol is merely defined, and not assigned a usable value.
  31.  
  32. -g    Generate debugging information in DBX-compatible format.  When
  33.         compiled for the Amiga, it instead names the assembler SECTIONs
  34.         after the C source file from which they are generated.
  35.  
  36. -I %s    Add the directory %s to the list of directories to scan when searching
  37.     for a header file.
  38.  
  39. -l    Generate a source listing file.
  40.  
  41. -n    No optimization is to be performed.  The compiler's default behavior
  42.     is to optimize the code it generates.
  43.  
  44. -o %s    The assembly language output file should be named %s.  Behavior is
  45.         unspecified when multiple input files are specified.
  46.  
  47. -P %s    Pre-compile the program by dumping a symbol table into a file when %s
  48.     is given as 0 (ie, -P0).  Otherwise, read the pre-compiled header
  49.     file of name %s.  This can greatly speed compilation if you compile
  50.     all of your header files into a symbol table file.  From then on,
  51.     the compiler will no longer have to search for, read, and parse the
  52.     header files your program uses every time a compile is performed.
  53.         This option is of highest utility when developing on a floppy-only
  54.         system.
  55.  
  56. -q    Run quietly.  Prevents the compiler from printing out information
  57.     on the functions compiled and their table usage.
  58.  
  59. -r    Toggles use of a scanned library for integer operations.
  60.  
  61. -f %s    Use %s as the pointer into the auto variable area of the stack frame
  62.     (this pointer is also known as a "frame pointer".) '-F' is a synonym
  63.     for '-f'.
  64.  
  65. -U %s   Remove symbol %s from the list of preprocessor symbols before use.
  66.  
  67. -?    Presents a help screen.
  68.  
  69.  
  70.  
  71. [ What follows is a start at a thorough documentation effort ]
  72.  
  73.  
  74. PDC's Preprocessor
  75. ------------------
  76. - The #pragma directive
  77.     libcall
  78.     intmath
  79. - #define, #undef
  80. - Conditionals: #if, defined(), #ifdef, #ifndef, #else, #endif
  81. * See H&S for others
  82.  
  83. --------------------
  84.  
  85. The #pragma directive:
  86.  
  87. PDC currently supports two types of #pragma's: libcall and intmath.
  88.  
  89. libcall pragmas:
  90.  
  91. Allows inlining of shared library library calls; compatible with Lattice.
  92.  
  93.  
  94. intmath pragmas:
  95.  
  96. There is a problem with using the CPU instructions for performing
  97. integer math: they work on 16-bit quantities.  So for instance, you
  98. can't multiply 66000 times 3 even though it fits well within the
  99. limits for 32 bit integers.  For some applications, this doesn't
  100. matter- and the speed is well worth the cost.  But some people
  101. nonetheless need real 32-bit math.  So PDC can alternately generate
  102. code for calling libraries to perform true 32-bit integer math
  103. (these routines are part of PDC.lib and their source is in the file
  104. sysio/lib.asm) or use inline 680x0 instructions like MULS and DIVS
  105. that are plenty fast, but must be used with caution.  
  106.  
  107. Here is an example of how the intmath #pragma's are used:
  108.    
  109. --------------------
  110.  
  111. #define and #undef (Descriptions taken from H&S)
  112. Conditionals: #if, defined(), #ifdef, #ifndef, #else, #endif
  113.  
  114. #define    Defines a preprocessor macro.
  115. #undef     Removes a macro definition
  116. #include   Insert text from another file.
  117. #if        Conditionally include some text, based on the value of a constant
  118.            expression.
  119. defined()  Macro is true if specified name is defined.
  120. #ifdef     Conditionally include some text, based on whether the specified
  121.            macro name is defined.
  122. #ifndef    Like #ifdef, but instead works if a macro name is NOT defined.
  123. #else      Include text if previous #if, #ifdef, or #ifndef test failed.
  124. #endif     Terminate conditional text.
  125.  
  126. --------------------
  127.  
  128. #line supplies a new line number to count from for compiler messages.
  129.  
  130. --------------------